%
Function mySubj()
x= Request.Form("Email")
response.write x
'x="hello"
'MsgBox(x)
mySubj = "1"
end Function
Sub MyVbTest()
MsgBox("Testing from VB Script!")
End Sub
Function sha256hashBytes(aBytes)
Dim sha256
set sha256 = CreateObject("System.Security.Cryptography.SHA256Managed")
sha256.Initialize()
'Note you MUST use computehash_2 to get the correct version of this method, and the bytes MUST be double wrapped in brackets to ensure they get passed in correctly.
sha256hashBytes = sha256.ComputeHash_2( (aBytes) )
End Function
Function stringToUTFBytes(aString)
Dim UTF8
Set UTF8 = CreateObject("System.Text.UTF8Encoding")
stringToUTFBytes = UTF8.GetBytes_4(aString)
End Function
Function copyfile()
carlos = CopyFile_RandomName("http://www.Phinancetechnologies.somee.com/website riskmath/Files/Demographic Projections RiskMath Book Country Report - Japan.pdf", "")
copyfile="http://www.Phinancetechnologies.somee.com/website riskmath/Files/Demographic Projections RiskMath Book Country Report - Japan.pdf"
'copyfile="Phinancetechnologies.somee.com/website riskmath/Files/Demographic Projections RiskMath Book Country Report - Japan.pdf"
'copyfile="content/Japan report.pdf"
End Function
Sub createfolder(FolderPath)
'verify if folder exists
Dim filesys, newfolder, newfolderpath
'newfolderpath = "C:\Web\Website Riskmath\temp2"
newfolderpath = FolderPath
set filesys=CreateObject("Scripting.FileSystemObject")
If Not filesys.FolderExists(newfolderpath) Then
Set newfolder = filesys.CreateFolder(newfolderpath)
End If
End Sub
'This function Copies a Source File to the Target Folder with a random name.
'It then appends the same extension of the original file.
'It returns the target File name for use elsewhere
Function CopyFile_RandomName(SourceFile, TargetFolder)
'Copy all files from fldr to destination folder and append the date (in ISO
'format) to the name. Overwrite existing files.
Dim fso, myfile
Set fso = CreateObject("Scripting.FileSystemObject")
source_f_name = fso.GetBaseName(sourceFile)
source_f_folder = fso.GetParentFolderName(sourceFile)
source_f_extension = fso.GetExtensionName(sourceFile)
set myfile = fso.GetFile(SourceFile)
targetFolder = TargetFolder
target_f_name = source_f_name & "_" & RandomString(10)
target_f_extension = source_f_extension
target_file = target_f_name & "." & target_f_extension
'target_file = "aaaa.pdf"
'full_target_file = targetFolder & target_file
myfile.Copy (targetFolder & "\" & target_file)
CopyFile_RandomName = targetFolder & "\" & target_file
End Function
Function RandomString(strLength)
Rndstr=""
LETTERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789_+-"
Randomize
For i = 1 to strLength
myval = Len(LETTERS)*Rnd
Rndstr = Rndstr & Mid( LETTERS, Int(myval+1), 1 )
Next
RandomString = Rndstr
End Function
'This function Copies a Source File to the Target File.
Function CopyFile_Phitech(SourceFile, TargetFile)
Dim fso, myfile
Set fso = CreateObject("Scripting.FileSystemObject")
set myfile = fso.GetFile(SourceFile)
myfile.Copy (TargetFile)
CopyFile_Phitech = TargetFile
End Function
Function myDateFormat(myDate)
d = TwoDigits(Day(myDate))
m = TwoDigits(Month(myDate))
y = TwoDigits(Year(myDate))
h = TwoDigits(Hour(myDate))
mm = TwoDigits(Minute(myDate))
ss = TwoDigits(Second(mydate))
myDateFormat= y & "-" & m & "-" & d & " " & h & ":" & mm & ":" & ss
End Function
Function TwoDigits(num)
If(Len(num)=1) Then
TwoDigits="0"&num
Else
TwoDigits=num
End If
End Function
Sub createFolder(infolder)
Dim oFSO
Set oFSO = CreateObject("Scripting.FileSystemObject")
doesfolderexist = oFSO.FolderExists("C:\Web\Website Riskmath\" & infolder)
If Not doesfolderexist Then
oFSO.CreateFolder "C:\Web\Website Riskmath\" & infolder 'Create a new folder
End If
End sub
Function Return_ULI(userx, paxx)
Dim DB
Set DB=Server.CreateObject("ADODB.Connection")
DB.Open("DRIVER={SQL Server};SERVER=PhinancetechnologiesDB.mssql.somee.com;Initial Catalog=PhinancetechnologiesDB;user id=carlosalegria_SQLLogin_1;Password=pvc1zc3k3u")
sql="select * from login_users where user_login='"& user & "' and user_pass='"& pax&"'"
'response.write "
" & sql
Dim qa
set qa = Server.CreateObject("ADODB.Recordset")
qa.open sql, DB
Dim ULI
ULI=False
Dim pview
pview =""
if qa.eof then
response.write "USER NOT RECOGNIZED"
loginFailed= True
else
response.write "